<template>
	<view class="">
		<!-- 公司员工 -->
		<view class="adress-box">
			<view class="adress-head">
				<image src="/static/aqy.png" mode=""></image>
				<span>驻村安全员</span>
			</view>
			<view class="adress-item" v-for="(items,index) in list1" :key="index">
				<span class="adress-item-left">{{items.realname}}</span>
				<view class="adress-item-right" @tap="tapMobile(items.mobile)">
					<image src="/static/dianhua2.png" mode=""></image>
					<span>{{items.mobile}}</span>
				</view>
			</view>
		</view>
		<view class="adress-box">
			<view class="adress-head">
				<image src="/static/aqy.png" mode=""></image>
				<span>村内协管员</span>
			</view>
			<view class="adress-item" v-for="(items,index) in list2" :key="index">
				<span class="adress-item-left">{{items.realname}}</span>
				<view class="adress-item-right" @tap="tapMobile(items.mobile)">
					<image src="/static/dianhua2.png" mode=""></image>
					<span>{{items.mobile}}</span>
				</view>
			</view>
		</view>
		<view class="adress-box">
			<view class="adress-head">
				<image src="/static/qiye.png" mode=""></image>
				<span>武强中顺</span>
			</view>
			<view class="adress-item" v-for="(items,index) in list3" :key="index">
				<span class="adress-item-left">{{items.realname}}</span>
				<view class="adress-item-right" @tap="tapMobile(items.mobile)">
					<image src="/static/dianhua2.png" mode=""></image>
					<span>{{items.mobile}}</span>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				showR: true,
				username: '',
				password: '',
				// array: ['安装工','检测工','维修工'],
				index: 0,
				userinfo: {},
				value: '', //搜索关键词
				installList: [], //安装列表
				dosearch: false,
				showAcount: false,
				page: 1,
				list1: [],
				list2: [],
				list3: [],
				// 取消电话
				mobileFlag: false,
				dial_mobile: '',
				token: ''
			};
		},
		onLoad() {
			uni.getStorage({
				key: 'userinfo',
				success: (res) => {
					this.userinfo = res.data
				}
			})

			// this.getInstallDetail()
		},
		onShow() {
			uni.getStorage({
				key: 'token'
			}).then(da => {
				this.token = da[1].data
			})
			setTimeout(() => {
				this.getData()
			}, 10)
		},
		methods: {
			getData() {
				let that = this
				that.$request.request({
					url: '/Village/get_mobile',
					method: 'GET',
					data: {
						token: that.token
					}
				}).then(res => {
					// console.log(res.data.data.assistant)
					that.list1 = res.data.data.safer
					that.list2 = res.data.data.assistant
					that.list3 = res.data.data.staff
				})
			},
			close() {
				uni.navigateBack({
					delta: 1
				});
			},
			tapMobile(hd) {
				uni.makePhoneCall({
					phoneNumber: hd,
					success: (res) => {
						console.log(res);
					},
					fail: (err) => {
						console.log(err);
					}
				});
			}
		},

	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #F5F5F5;
		// padding-bottom: 200rpx;
		// margin-bottom: 150rpx;
	}

	.content {
		position: relative;
		padding-bottom: 140rpx;
	}

	// header
	.header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 30rpx 30rpx;
		background-color: #fff;

		.header-left {
			display: flex;
			align-items: center;
			font-size: 32rpx;
			font-weight: 500;
			color: #333;

			image {
				width: 24rpx;
				height: 24rpx;
				margin-right: 20rpx;
			}
		}

		.header-right {
			display: flex;
			align-items: center;
			font-size: 24rpx;
			color: #333;

			image {
				width: 32rpx;
				height: 32rpx;
				margin-right: 10rpx;
			}
		}
	}

	.adress-box {
		margin-top: 20rpx;
		background-color: #fff;

		.adress-head {
			display: flex;
			align-items: center;
			padding: 10rpx 24rpx;
			font-size: 32rpx;
			font-weight: 500;
			color: #003690;

			image {
				width: 36rpx;
				height: 36rpx;
				margin-right: 10rpx;
			}
		}

		.adress-item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 10rpx 24rpx 28rpx 24rpx;
			border-bottom: 2rpx solid #f5f5f5;

			.adress-item-left {
				padding-left: 10rpx;
				font-size: 32rpx;
				color: #333;
			}

			.adress-item-right {
				display: flex;
				align-items: center;
				font-size: 28rpx;
				color: #999;

				image {
					width: 36rpx;
					height: 36rpx;
					margin-right: 10rpx;
				}
			}
		}
	}

	.mobileBottom {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;

		.bottom-top {
			display: flex;
			height: 86rpx;
			background-color: #fff;
			justify-content: center;
			align-items: center;
			line-height: 86rpx;

			image {
				width: 36rpx;
				height: 36rpx;
			}

			text {
				font-size: 32rpx;
				text-align: left;
				color: #333333;
			}
		}

		.bottom-qx {
			height: 86rpx;
			line-height: 86rpx;
			background-color: #fff;
			text-align: center;
			font-size: 24rpx;
			color: #333333;
			margin-top: 12rpx;
		}
	}
</style>
